"""
Pydantic 数据模型
"""

from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime

class MessageResponse(BaseModel):
    message: str = Field(..., description="响应消息")
    data: Optional[dict] = Field(None, description="附加数据")

class RequestLog(BaseModel):
    time: datetime
    method: str
    path: str
    status_code: int
    client_ip: str
    cost_ms: float
    user_agent: Optional[str]

class RateLimitResponse(BaseModel):
    detail: str = Field(..., example="Rate limit exceeded, try again later")
